Add yet more patches to make the installed-tests work
authorSimon McVittie <smcv@debian.org>
Fri, 1 Apr 2016 05:59:13 +0000 (06:59 +0100)
committerSimon McVittie <smcv@debian.org>
Fri, 1 Apr 2016 05:59:13 +0000 (06:59 +0100)
13 files changed:
debian/patches/In-tests-that-use-gpg-terminate-the-gpg-agent-after-testi.patch
debian/patches/Load-g-i-bindings-from-builddir-during-build-time-testing.patch
debian/patches/Probe-for-GNU-parallel-more-accurately.patch
debian/patches/Skip-tests-that-run-rofiles-fuse-if-dev-fuse-or-etc-mtab-.patch
debian/patches/Symlink-libreaddir-rand.so-into-tests-directory.patch
debian/patches/libtest.sh-only-check-whether-pwd-is-empty-once.patch [new file with mode: 0644]
debian/patches/libtest.sh-use-G_TEST_SRCDIR-G_TEST_BUILDDIR-to-find-reso.patch [new file with mode: 0644]
debian/patches/series
debian/patches/tap-test-clean-up-temporary-test-directories-as-intended.patch
debian/patches/test-xattrs-sync-how-this-is-skipped-with-test-rofiles-fu.patch [new file with mode: 0644]
debian/patches/test-xattrs-use-TAP-syntax-to-skip-test.patch
debian/patches/tests-admin-test.sh-this-is-a-bash-script-not-a-POSIX-sh-.patch
debian/patches/various-tests-skip-if-temp-directory-lacks-xattr-support.patch

index 7b6fff293ab5932bd9ec9412ace5c812ed700445..15032e06ee1c0c2e03d5afc5ce2646ef2ca61c3d 100644 (file)
@@ -5,7 +5,7 @@ Subject: In tests that use gpg, terminate the gpg-agent after testing
 Otherwise we leak those processes.
 
 Signed-off-by: Simon McVittie <smcv@debian.org>
-Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/b25ddd29ab8eb56bc1022dd38758e54dc4b2ccbe
+Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/b25ddd29ab8eb56bc1022dd38758e54dc4b2ccbe
 ---
  tests/test-commit-sign.sh         | 1 +
  tests/test-gpg-signed-commit.sh   | 2 ++
index 6542d01ae172a3d2b74cbba390f60fa7d6dc451d..cb673ce6b2e0a7c7c43634fde3f6288528b1a1c1 100644 (file)
@@ -1,28 +1,26 @@
 From: Simon McVittie <smcv@debian.org>
-Date: Thu, 31 Mar 2016 09:02:23 +0100
+Date: Thu, 31 Mar 2016 18:36:04 +0100
 Subject: Load g-i bindings from builddir during build-time testing
 
 Previously, the build-time tests would only pass if the g-i bindings to
 OSTree were already installed, with a reasonably similar version.
 
 Signed-off-by: Simon McVittie <smcv@debian.org>
-Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/07aa8e1c76463e3de0ffc79d0271773ababf05b4
-[smcv: rebased on 2016.4]
+Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/07aa8e1c76463e3de0ffc79d0271773ababf05b4
+[smcv: backport to 2016.4]
 ---
- Makefile-tests.am | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
+ Makefile-tests.am | ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
 
 diff --git a/Makefile-tests.am b/Makefile-tests.am
-index 9eb9ad8..f10c23f 100644
+index 9eb9ad8..e7c2395 100644
 --- a/Makefile-tests.am
 +++ b/Makefile-tests.am
-@@ -23,7 +23,12 @@ include $(top_srcdir)/buildutil/glib-tap.mk
+@@ -23,7 +23,10 @@ include $(top_srcdir)/buildutil/glib-tap.mk
  # include the builddir in $PATH so we find our just-built ostree
  # binary.
  TESTS_ENVIRONMENT += OT_TESTS_DEBUG=1 \
 -      PATH=$$(cd $(top_builddir) && pwd):$${PATH}
-+      SRCDIR=$$(cd $(top_srcdir) && pwd) \
-+      BUILDDIR=$$(cd $(top_builddir) && pwd) \
 +      GI_TYPELIB_PATH=$$(cd $(top_builddir) && pwd) \
 +      LD_LIBRARY_PATH=$$(cd $(top_builddir)/.libs && pwd) \
 +      PATH=$$(cd $(top_builddir) && pwd):$${PATH} \
index 6532bd87cb9a71d0d7edab3ddda5c18c22cacb4a..d13e53aff2a2a735804eb5e171cb969a980b9529 100644 (file)
@@ -16,7 +16,7 @@ some versions optionally supported an incompatible command-line syntax
 taken from moreutils parallel.
 
 Signed-off-by: Simon McVittie <smcv@debian.org>
-Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/9dafc820241ed6e663ad4093660fc255f549aa26
+Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/9dafc820241ed6e663ad4093660fc255f549aa26
 ---
  tests/test-admin-locking.sh | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
index 08b683e5e8d950dd8874299fdcb54d10f549987e..a0a548b2959d8017ec69cd77db3c25eeb89a88f5 100644 (file)
@@ -4,7 +4,7 @@ Subject: Skip tests that run rofiles-fuse if /dev/fuse or /etc/mtab
  unavailable
 
 Signed-off-by: Simon McVittie <smcv@debian.org>
-Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/e1ce859368b41c863fe096df84f1ff33e90d725f
+Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/e1ce859368b41c863fe096df84f1ff33e90d725f
 ---
  tests/libtest.sh               | 17 +++++++++++++++++
  tests/test-demo-buildsystem.sh |  6 +-----
index ef8cae1017056bb2280b2088dc98aa20ad8143fc..a2f96746a6e2ba5bb48746c8b63ef497e2e32587 100644 (file)
@@ -5,7 +5,7 @@ Subject: Symlink libreaddir-rand.so into tests directory
 This means it can be LD_PRELOADed during build-time testing.
 
 Signed-off-by: Simon McVittie <smcv@debian.org>
-Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/f8bef792cb9cdd8b9cd174dad5856727db3b9bad
+Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/f8bef792cb9cdd8b9cd174dad5856727db3b9bad
 ---
  .gitignore        | 1 +
  Makefile-decls.am | 3 +++
diff --git a/debian/patches/libtest.sh-only-check-whether-pwd-is-empty-once.patch b/debian/patches/libtest.sh-only-check-whether-pwd-is-empty-once.patch
new file mode 100644 (file)
index 0000000..1fc111a
--- /dev/null
@@ -0,0 +1,31 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Thu, 31 Mar 2016 17:52:57 +0100
+Subject: libtest.sh: only check whether $(pwd) is empty once
+
+test-sysroot.js runs libtestExec() twice, one of which is after
+creating non-hidden directories in $(pwd), so this check needs to be
+skipped the second time.
+
+Signed-off-by: Simon McVittie <smcv@debian.org>
+Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/18e9169d7ae76149833475c14f4c7147f6f91c9e
+---
+ tests/libtest.sh | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/tests/libtest.sh b/tests/libtest.sh
+index f588e65..f22ba4b 100755
+--- a/tests/libtest.sh
++++ b/tests/libtest.sh
+@@ -41,8 +41,12 @@ test_tmpdir=$(pwd)
+ if ! test -f .testtmp; then
+     files=$(ls)
+     if test -n "${files}"; then
++      ls -l
+       assert_not_reached "test tmpdir=${test_tmpdir} is not empty; run this test via \`make check TESTS=\`, not directly"
+     fi
++    # Remember that this is an acceptable test $(pwd), for the benefit of
++    # C and JS tests which may source this file again
++    touch .testtmp
+ fi
+ export G_DEBUG=fatal-warnings
diff --git a/debian/patches/libtest.sh-use-G_TEST_SRCDIR-G_TEST_BUILDDIR-to-find-reso.patch b/debian/patches/libtest.sh-use-G_TEST_SRCDIR-G_TEST_BUILDDIR-to-find-reso.patch
new file mode 100644 (file)
index 0000000..743c1f1
--- /dev/null
@@ -0,0 +1,109 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Thu, 31 Mar 2016 18:29:44 +0100
+Subject: libtest.sh: use G_TEST_SRCDIR, G_TEST_BUILDDIR to find resources
+
+This fixes the bug that in installed-tests that run testlib.sh under
+"bash -c" (i.e. the C and JS tests), $(dirname $0) is "." and we can't do
+the LD_PRELOAD correctly:
+
+ERROR: ld.so: object './libreaddir-rand.so' from LD_PRELOAD cannot be
+preloaded (cannot open shared object file): ignored.
+
+Similarly, those tests can't copy gpghome correctly.
+
+This also removes the confusing situation that SRCDIR in libtest.sh
+(which is ${top_srcdir}/tests) does not mean the same thing as SRCDIR
+in test-abi.sh (which is just ${top_srcdir}).
+
+Signed-off-by: Simon McVittie <smcv@debian.org>
+Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/efb86ba9d32a038dd90f47f6e82f578e91b5fef5
+---
+ tests/libtest.sh             | 18 ++++++++++++++----
+ tests/test-archivez.sh       |  2 +-
+ tests/test-delta.sh          |  4 ++--
+ tests/test-pull-archive-z.sh |  2 +-
+ 4 files changed, 18 insertions(+), 8 deletions(-)
+
+diff --git a/tests/libtest.sh b/tests/libtest.sh
+index 3e4c4bd..f588e65 100755
+--- a/tests/libtest.sh
++++ b/tests/libtest.sh
+@@ -17,7 +17,17 @@
+ # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ # Boston, MA 02111-1307, USA.
+-SRCDIR=$(dirname $0)
++if [ -n "${G_TEST_SRCDIR:-}" ]; then
++  test_srcdir="${G_TEST_SRCDIR}/tests"
++else
++  test_srcdir=$(dirname $0)
++fi
++
++if [ -n "${G_TEST_BUILDDIR:-}" ]; then
++  test_builddir="${G_TEST_BUILDDIR}/tests"
++else
++  test_builddir=$(dirname $0)
++fi
+ assert_not_reached () {
+     echo $@ 1>&2; exit 1
+@@ -54,7 +64,7 @@ export TEST_GPG_KEYID_3="DF444D67"
+ # homedir in order to create lockfiles.  Work around
+ # this by copying locally.
+ echo "Copying gpghome to ${test_tmpdir}"
+-cp -a ${SRCDIR}/gpghome ${test_tmpdir}
++cp -a "${test_srcdir}/gpghome" ${test_tmpdir}
+ export TEST_GPG_KEYHOME=${test_tmpdir}/gpghome
+ export OSTREE_GPG_HOME=${test_tmpdir}/gpghome/trusted
+@@ -63,9 +73,9 @@ if test -n "${OT_TESTS_DEBUG:-}"; then
+ fi
+ if test -n "${OT_TESTS_VALGRIND:-}"; then
+-    CMD_PREFIX="env G_SLICE=always-malloc valgrind -q --leak-check=full --num-callers=30 --suppressions=${SRCDIR}/ostree-valgrind.supp"
++    CMD_PREFIX="env G_SLICE=always-malloc valgrind -q --leak-check=full --num-callers=30 --suppressions=${test_srcdir}/ostree-valgrind.supp"
+ else
+-    CMD_PREFIX="env LD_PRELOAD=${SRCDIR}/libreaddir-rand.so"
++    CMD_PREFIX="env LD_PRELOAD=${test_builddir}/libreaddir-rand.so"
+ fi
+ assert_streq () {
+diff --git a/tests/test-archivez.sh b/tests/test-archivez.sh
+index 999157d..b879328 100755
+--- a/tests/test-archivez.sh
++++ b/tests/test-archivez.sh
+@@ -25,7 +25,7 @@ echo '1..11'
+ setup_test_repository "archive-z2"
+-. ${SRCDIR}/archive-test.sh
++. ${test_srcdir}/archive-test.sh
+ cd ${test_tmpdir}
+ mkdir repo2
+diff --git a/tests/test-delta.sh b/tests/test-delta.sh
+index a6fd6f8..411e9b0 100755
+--- a/tests/test-delta.sh
++++ b/tests/test-delta.sh
+@@ -130,9 +130,9 @@ assert_streq "${totalsize_orig}" "${totalsize_swapped}"
+ echo 'ok generate + show endian swapped'
+-tar xf ${SRCDIR}/pre-endian-deltas-repo-big.tar.xz
++tar xf ${test_srcdir}/pre-endian-deltas-repo-big.tar.xz
+ mv pre-endian-deltas-repo{,-big}
+-tar xf ${SRCDIR}/pre-endian-deltas-repo-little.tar.xz
++tar xf ${test_srcdir}/pre-endian-deltas-repo-little.tar.xz
+ mv pre-endian-deltas-repo{,-little}
+ legacy_origrev=$(${CMD_PREFIX} ostree --repo=pre-endian-deltas-repo-big rev-parse main^)
+ legacy_newrev=$(${CMD_PREFIX} ostree --repo=pre-endian-deltas-repo-big rev-parse main)
+diff --git a/tests/test-pull-archive-z.sh b/tests/test-pull-archive-z.sh
+index 2ea2387..66f8873 100755
+--- a/tests/test-pull-archive-z.sh
++++ b/tests/test-pull-archive-z.sh
+@@ -23,4 +23,4 @@ set -euo pipefail
+ setup_fake_remote_repo1 "archive-z2"
+-. ${SRCDIR}/pull-test.sh
++. ${test_srcdir}/pull-test.sh
index e64eb1e13dc71966886c8ddaee683460b347936f..8f932916d52cb1dbfa049acfcfb6ff9e3f97d06b 100644 (file)
@@ -7,3 +7,6 @@ Load-g-i-bindings-from-builddir-during-build-time-testing.patch
 tests-admin-test.sh-this-is-a-bash-script-not-a-POSIX-sh-.patch
 Skip-tests-that-run-rofiles-fuse-if-dev-fuse-or-etc-mtab-.patch
 Probe-for-GNU-parallel-more-accurately.patch
+libtest.sh-use-G_TEST_SRCDIR-G_TEST_BUILDDIR-to-find-reso.patch
+test-xattrs-sync-how-this-is-skipped-with-test-rofiles-fu.patch
+libtest.sh-only-check-whether-pwd-is-empty-once.patch
index c7a21e36da6c88be5ca2d6e949aa688b39414bc1..45e5e55d62105b8376ed2f930b0b626bfbd18a55 100644 (file)
@@ -9,7 +9,7 @@ This means the various "ostree trivial-httpd --autoexit" processes
 actually exit, because their web roots are cleaned up now.
 
 Signed-off-by: Simon McVittie <smcv@debian.org>
-Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/47fd5c74f1428d4cc02ff0061a4958c4b714e852
+Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/47fd5c74f1428d4cc02ff0061a4958c4b714e852
 ---
  buildutil/tap-test | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debian/patches/test-xattrs-sync-how-this-is-skipped-with-test-rofiles-fu.patch b/debian/patches/test-xattrs-sync-how-this-is-skipped-with-test-rofiles-fu.patch
new file mode 100644 (file)
index 0000000..9a88fd6
--- /dev/null
@@ -0,0 +1,38 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Thu, 31 Mar 2016 17:47:36 +0100
+Subject: test-xattrs: sync how this is skipped with test-rofiles-fuse
+
+If we touch test-xattrs before sourcing libtest.sh, we get:
+
+test tmpdir=/tmp/test-tmp-ostree_test-xattrs.sh.test-HSEXEY is not
+empty; run this test via `make check TESTS=`, not directly
+
+Signed-off-by: Simon McVittie <smcv@debian.org>
+Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/9c4babf316cfbfad61cfcd0ab8fd5e77e9df13be
+---
+ tests/test-xattrs.sh | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/tests/test-xattrs.sh b/tests/test-xattrs.sh
+index 2f2d99c..cdc06e8 100755
+--- a/tests/test-xattrs.sh
++++ b/tests/test-xattrs.sh
+@@ -19,15 +19,11 @@
+ set -euo pipefail
+-touch test-xattrs
+-if ! setfattr -n user.testvalue -v somevalue test-xattrs; then
+-    echo "1..0 # SKIP: cannot run setfattr"
+-    exit 0
+-fi
++. $(dirname $0)/libtest.sh
+-echo "1..2"
++skip_without_user_xattrs
+-. $(dirname $0)/libtest.sh
++echo "1..2"
+ setup_test_repository "archive-z2"
index b730f0faae5e8f9de1a3c87c8e166fbcbdf538e9..e5a169d617e567c3b0da735724853eb64c634660 100644 (file)
@@ -3,7 +3,7 @@ Date: Mon, 28 Mar 2016 13:08:32 +0100
 Subject: test-xattrs: use TAP syntax to skip test
 
 Signed-off-by: Simon McVittie <smcv@debian.org>
-Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/c276025466af4319d603fe8b534dd3463818a168
+Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/c276025466af4319d603fe8b534dd3463818a168
 ---
  tests/test-xattrs.sh | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
index e0b228b8a29d427d551706d9c747bf459f1fffda..c462a643c14b7bc30651bd513128d4856a80419f 100644 (file)
@@ -7,7 +7,7 @@ PR #226 that he prefers to require bash rather than trying to support
 every POSIX shell.
 
 Signed-off-by: Simon McVittie <smcv@debian.org>
-Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/1dd85513e540ef0b42f2fee7238fa1f710eaa4ca
+Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/1dd85513e540ef0b42f2fee7238fa1f710eaa4ca
 ---
  tests/admin-test.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
index d34ec12c3036e111c4586642af351e5f1b87dd56..8a340d50ae77205893f169cda5f66cfa90d15763 100644 (file)
@@ -6,7 +6,7 @@ Some autobuilder environments place the entire build chroot on tmpfs, so
 even /var/tmp might not have this.
 
 Signed-off-by: Simon McVittie <smcv@debian.org>
-Applied-upstream: 2016.5, https://github.com/ostreedev/ostree/commit/3e3755c497bd85e22b01829c5715119d46394687
+Applied-upstream: 2016.5, commit:https://github.com/ostreedev/ostree/commit/3e3755c497bd85e22b01829c5715119d46394687
 ---
  tests/libtest.sh               | 8 ++++++++
  tests/test-basic-user.sh       | 6 ++++--